<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Material_Design风格的时间选择器 Bootstrap-material-datetimepicker - 光年(Light Year Admin V4)后台管理系统模板</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="Light Year Admin V4是一个基于Bootstrap v4.4.1的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="http://lyear.itshubao.com/iframe/v4/css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="js/bootstrap-material-datetimepicker/bootstrap-material-datetimepicker.min.css" rel="stylesheet">
<link href="http://lyear.itshubao.com/iframe/v4/css/style.min.css" rel="stylesheet">
<style>

</style>
</head>
  
<body>
<div class="container-fluid">
  
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><div class="card-title">Material_Design风格的时间选择器 Bootstrap-material-datetimepicker</div></div>
        <div class="card-body">
          
          <div class="form-group">
            <label for="date-picker">日期选择器</label>
            <input type="text" id="date-picker" class="form-control" placeholder="日期" />
          </div>
          <div class="form-group">
            <label for="time-picker">时间选择器</label>
            <input type="text" id="time-picker" class="form-control" placeholder="时间" />
          </div>
          <div class="form-group">
            <label for="date-format">日期时间</label>
            <input type="text" id="date-format" class="form-control" placeholder="开始日期时间" />
          </div>
          <div class="form-group">
            <label for="min-date">最小日期</label>
            <input type="text" id="min-date" class="form-control" placeholder="开始日期" />
          </div>
          <div class="form-group">
            <label for="date-start">事件</label>
            <div class="input-group">
              <input class="form-control" type="text" id="date-start" placeholder="从" />
              <div class="input-group-prepend input-group-append"><span class="input-group-text"><i class="mdi mdi-chevron-right"></i></span></div>
              <input class="form-control" type="text" id="date-end" placeholder="至" />
            </div>
          </div>
          
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="http://lyear.itshubao.com/iframe/v4/js/jquery.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/v4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/moment/moment.min.js"></script><!--这个文件在原模板的bootstrap-datetimepicker中有，这里将它挪出来了-->
<script type="text/javascript" src="js/moment/locale/zh-cn.js"></script>
<script type="text/javascript" src="js/bootstrap-material-datetimepicker/bootstrap-material-datetimepicker.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    // 日期
    $('#date-picker').bootstrapMaterialDatePicker({
        time: false,
        //lang: 'zh-cn', // 已将默认改成zh-cn
		clearButton: true
    });
    // 时间
    $('#time-picker').bootstrapMaterialDatePicker({
        date: false,
		shortTime: false,
		format: 'HH:mm'
    });
    // 日期时间格式化
    $('#date-format').bootstrapMaterialDatePicker({
        format : 'YYYY-MM-DD HH:mm'
    });
    // 最小日期
    $('#min-date').bootstrapMaterialDatePicker({
        format : 'YYYY-MM-DD HH:mm',
        minDate : new Date()
    });
    // 事件
    $('#date-end').bootstrapMaterialDatePicker({
        weekStart : 0,
        format: 'YYYY-MM-DD HH:mm'
    });
    $('#date-start').bootstrapMaterialDatePicker({ 
        weekStart : 0,
        format: 'YYYY-MM-DD HH:mm',
        shortTime : true
    }).on('change', function(e, date) {
        $('#date-end').bootstrapMaterialDatePicker('setMinDate', date);
    });
});
</script>
</body>
</html>